package cn.hdu.liang.ch02;

/**
 * 如果内置锁不是可重入的，这段代码将发生死锁
 */

class Widget {
    public synchronized void doSomething() {
    }
}

class LoggingWidget extends Widget {
    public synchronized void doSomething() {
        System.out.println(toString() + ": calling doSomething");
        super.doSomething();
    }
}
